import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import router from './router'
import store from './store'
Vue.config.productionTip = false
Vue.use(ElementUI);
new Vue({
  router,
  store,
  render: h => h(App),
  mounted() {
    setRem();
  }
}).$mount('#app')

// rem适配
function setRem() {
  var whdef = 100 / 1920;
  var bodyWidth = document.body.clientWidth;
  var rem = bodyWidth * whdef;
  document.getElementsByTagName('html')[0].style.fontSize = rem + 'px';
}
window.addEventListener('load', setRem);
window.addEventListener('resize', setRem);
